package com.fieldchain.ex.fa100.utils.chart.dataset;

import android.graphics.Color;

import com.github.mikephil.charting.data.BarDataSet;
import com.github.mikephil.charting.data.BarEntry;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by biyunlong
 * Email: 1225198434@qq.com
 * Data:  2018/10/5
 */
public class MyBarDataSet extends BarDataSet {
    private List<MyBarEntry> mVals = new ArrayList<>();

    public MyBarDataSet(List<MyBarEntry> vals, List<BarEntry> entries, String label) {
        super(entries, label);
        mVals.clear();
        mVals.addAll(vals);

        List<Integer> cList = new ArrayList<>();
        cList.add(Color.parseColor("#ff0000"));
        cList.add(Color.parseColor("#006400"));

        setHighLightColor(Color.parseColor("#ffffff"));
        setColors(cList);
        setDrawValues(false);
        setHighlightEnabled(false);
    }
    @Override
    public MyBarEntry getEntryForIndex(int index) {
        return mVals.get(index);
    }
}

